<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  <template slot-scope="scope">
    <el-button
      size="mini"
      type="text"
      icon="el-icon-edit"
      @click="handleUpdate(scope.row)"
      v-hasPermi="['system:dbmanagement:edit']"
    >修改</el-button>
    <el-button
      size="mini"
      type="text"
      icon="el-icon-delete"
      @click="handleDelete(scope.row)"
      v-hasPermi="['system:dbmanagement:remove']"
    >删除</el-button>
    <el-button
      size="mini"
      type="text"
      icon="el-icon-connection"
      @click="handleTest(scope.row)"
      v-hasPermi="['system:dbmanagement:test']"
    >测试连接</el-button>
    <el-button
      size="mini"
      type="text"
      icon="el-icon-download"
      @click="handleBackup(scope.row)"
      v-hasPermi="['system:dbmanagement:backup']"
    >备份</el-button>
    <el-button
      size="mini"
      type="text"
      icon="el-icon-upload2"
      @click="handleRestore(scope.row)"
      v-hasPermi="['system:dbmanagement:restore']"
    >还原</el-button>
  </template>
</el-table-column>

<!-- 加上备份对话框组件 -->
<backup-dialog ref="backupDialog" @success="getList"></backup-dialog>

<script>
// 导入备份对话框组件
import BackupDialog from "./backup-dialog";

export default {
  name: "Database",
  components: {
    BackupDialog
  },
  methods: {
    /** 备份按钮操作 */
    handleBackup(row) {
      this.$refs.backupDialog.open(row.dbId);
    },
  }
}
</script> 